#ifndef LISTWIDGET_H
#define LISTWIDGET_H

#include <QCloseEvent>
#include <QDockWidget>
#include <QVector>
#include "character.h"
#include "word.h"

namespace Ui {
class ListWidget;
}

class ListWidget : public QDockWidget
{
    Q_OBJECT

public:
    ListWidget(const QVector<Character>& list, QWidget *parent = nullptr);
    ListWidget(const QVector<Word>& WordList, QWidget *parent = nullptr);
    ~ListWidget();

protected:
    void closeEvent(QCloseEvent * event);
    template<typename T>
    void SetList(const QVector<T>& list);
    void SetList();

signals:
    void CloseWidget();

private:
    Ui::ListWidget *ui;
    const QVector<Character> charList;
    const QVector<Word> wordList;
};

#endif // LISTWIDGET_H
